package com.zjxf.repository;

import com.zjxf.base.bean.po.PmsAsProductClassify;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

/**
 * 农副产品分类
 *
 * @author ZhangWei
 * @date 2021/4/6/006 16:52
 */
public interface PmsAsProductClassifyRepository extends JpaRepository<PmsAsProductClassify, Long>, JpaSpecificationExecutor<PmsAsProductClassify> {

    /**
     * 根据id与删除状态
     * @param id
     * @param deleteState
     * @return
     */
    Optional<PmsAsProductClassify> findByIdAndDeleteState(Long id, Integer deleteState);

    /**
     * 根据上级id进行查询
     * @param pId
     * @param deleteState
     * @return
     */
    List<PmsAsProductClassify> findByPIdAndDeleteState(Long pId, Integer deleteState);
}
